import request from '../utils/request'

export default{
    //查询所有角色
    queryAllRole(data){
        return request.post(`/api/management-center/role/page`,data)
    },
    //新添角色
    saveRole(data){
        return request.post(`/api/management-center/role/save`,data)
    },
    //查询所有角色不带分页
    list(data){
        return request.post(`/api/management-center/role/list`,data)
    },    
    //根据id查询角色
    queryRoleByRoleId(roleId){
        return request.post(`/api/management-center/role/selectRoleByRoleId`,roleId)
    },
    //修改角色
    updateRoleByRoleId(data){
        return request.post(`/api/management-center/role/updateRoleByRoleId`,data)
    },
    //查询当前用户所拥有的角色
    queryRoleRelationAllUser(data){
        return request.post(`/api/management-center/role/selectRoleRelationAllUser`,data)
    },

    // 给当前角色添加用户
    addRoleRelationUser(data){
        return request.post(`/api/management-center/userrole/addRoleRelationUser`,data)
    },
    queryMenuByRoleId(roleId){
        return request.post(`/api/management-center/role/selectMenuByRole`,roleId)
    },
    //角色关联菜单
    addRoleRelationMenu(data){
        return request.post(`/api/management-center/rolemenu/addRoleRelationMenu`,data)
    },
}